﻿@model List<LeEdu.MODEL.UserInfo>
@{
    Layout = null;
}

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="">
<!--<![endif]-->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="acdcccbbbcd0ceb9da02e9cd4c87736eb0033ee4" name="csrf-token" />
    <title>
        用户管理 -
        用户管理 -
        用户
        | EduSoho
    </title>
    <link href="/files/system/2015/06-20/102236c61b61855109.ico?6.9.3" rel="shortcut icon" />

    <script src="~/bootstrap-3.3.5-dist/jquery-2.0.0.min.js"></script>

    <script src="~/bootstrap-3.3.5-dist/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>


    <link href="~/bootstrap-3.3.5-dist/bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet" />

    <link href="~/Content/css/common.css" rel="stylesheet" />

    <link href="~/Content/css/admin.css" rel="stylesheet" />

    <link href="~/Content/css/admin_v2.css" rel="stylesheet" />

    <link href="~/Content/css/es-icon.css" rel="stylesheet" />

  





    <!--[if lt IE 9]>
      <script src="js/html5shiv.js?6.9.3"></script>
      <script src="js/respond.min.js?6.9.3"></script>
    <![endif]-->
</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/admin/user">乐知教育管理后台</a>
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">


                    <li class="active">
                        <a href="/admin/user">用户</a>
                    </li>



                    <li>
                        <a href="/Course/Index">课程</a>
                    </li>



                    <li>
                        <a href="/Group/GroupIndex">运营</a>
                    </li>



                    <li>
                        <a href="/admin/course/order/manage">订单</a>
                    </li>


                    <li>
                        <a href="/Trade/finance">账务</a>
                    </li>
                    <li>
                        <a href="/Log/Index">管理</a>
                    </li>  



                    @*<li>
                        <a href="/admin/app/center">教育云</a>
                    </li>*@
                    @*<li>
                        <a href="/Log/Index">管理</a>
                    </li>*@


                </ul>
                <ul class="nav navbar-nav navbar-right">
                  
                    <li><a href="/"><i class="glyphicon glyphicon-home"></i> 回首页</a></li>
                    <li class="dropdown">
                        <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-user"></i> @Session["Uname"] <span class="glyphicon glyphicon-chevron-down"></span></a>
                        <ul class="dropdown-menu main-list">
                            <li><a href="/Login/Index"><i class="glyphicon glyphicon-off"></i> 退出</a></li>
                        </ul>
                    </li>
                </ul>
            </div><!--/.navbar-collapse -->
        </div>
    </div>

    <div class="container">
        <div class="row">

            <div class="col-md-2">

                <div class="list-group">

                    <a class="list-group-item active"
                       href="/admin/User">用户管理</a>



                    <a class="list-group-item"
                       href="/admin/teacher">教师管理</a>



                    <a class="list-group-item"
                       href="/admin/approvals">实名认证管理</a>



                   


                </div>
            </div>
            <div class="col-md-10">
                <div class="page-header clearfix">
                    <h1 class="pull-left">用户管理</h1>
                    <div class="pull-right">
                        <a class="btn btn-success btn-sm"
                           data-url="/admin/user/create"
                           data-toggle="modal"
                           data-target="#modalAddUser">添加新用户</a>

                    </div>
                </div>




                <ul class="nav nav-tabs mbm">
                    <li class="active">
                        <a href="/admin/user">用户管理</a>
                    </li>
                    <li class="active">
                        <a href="/admin/user">日志管理</a>
                    </li>
                </ul>




                <form id="user-search-form" class="form-inline well well-sm" action="/Admin/SerchUser111" method="post" novalidate>
                    <div class="form-group">
                        <select class="form-control" name="RoleId">
                            <option value="0">--所有角色--</option>
                            <option value="1">学员</option>
                            <option value="2">教师</option>
                            <option value="3">管理员</option>
                 
                        </select>
                    </div>
                    <span class="divider"></span>


                    <div class="form-group">
                        <select id="keywordType" name="keywordType" class="form-control">
                            <option value="">--关键词类型--</option>
                            <option value="Uname">用户名</option>
                            <option value="PhoneNum">手机号</option>
                            <option value="Email">邮件地址</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <input type="text" id="keyword" name="keyword" class="form-control" value="" placeholder="添加相关词">
                    </div>
                    <button class="btn btn-primary" type="submit">搜索</button>
                </form>
                <table id="user-table" class="table table-striped table-hover" data-search-form="#user-search-form">
                    <thead>
                        <tr>
                            <th>用户名</th>
                            <th>手机号</th>
                            <th>Email</th>
                            <th>注册时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr id="user-table-tr-6">
                                <td>
                                    <strong>
                                        <a href="/Admin/SingleUser/@item.UserInfoId" data-toggle="modal" data-target="#myModal">@item.Uname</a>
                                    </strong>
                                    @if (item.SealState == 1)
                                    {
                                        <label id="jin" class="label label-danger">禁</label>
                                    }
                                 
                                    <br>
                                    <span class="text-muted text-sm">
                                        @(item.RoleId == 0 ? "管理员" : item.RoleId == 1 ? "学生" : item.RoleId == 2 ? "教师" : "其它")
                                    </span>
                                </td>
                                <td>
                                    @(item.PhoneNum == null ? "--" : item.PhoneNum)
                                </td>
                                <td>
                                    @item.Email
                                </td>
                                <td>
                                    <span class="text-sm">@item.UTime</span>
                                    <span></span>
                                </td>

                                <td>
                                    <div class="btn-group">

                                        <a href="/Admin/SingleUser/@item.UserInfoId" data-toggle="modal" data-target="#myModal" class="btn btn-default btn-sm">查看</a>
                                        <a href="#" type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
                                            <span class="caret"></span>
                                        </a>

                                        <ul class="dropdown-menu">
                                           
                                                <li><a href="/Admin/EditUser/@item.UserInfoId" data-target="#myModalEdit" data-toggle="modal">编辑用户信息</a></li>
                                                <li><a href="/Admin/EditUserRole/@item.UserInfoId" data-target="#RoleIdModal" data-toggle="modal">设置用户组</a></li>
                                                <li><a href="/Admin/EditUserRole/@item.UserInfoId" data-target="#RoleIdModal" data-toggle="modal">发送密码重置邮件</a></li>
                                                <li><a href="/Admin/EditUserRole/@item.UserInfoId" data-target="#RoleIdModal" data-toggle="modal">发送Email验证邮件</a></li>
                                                @*<li><a href="#" onclick="ChangeSealState(@item.UserInfoId)"><span id="jin"></span></a></li>*@
                                                @if (item.SealState == 1)
                                                {
                                                    <li id="xian"><a href="#" onclick="ChangeSealState(@item.UserInfoId)">解禁用户</a></li>
                                                }
                                                else
                                                {
                                                    <li id="xian1"><a href="#" onclick="ChangeSealState(@item.UserInfoId)">封禁用户</a></li>
                                                }
                                                
                                            @*<li><a href="/Admin/EditUser/@item.UserInfoId" data-target="#myModalEdit" data-toggle="modal">编辑用户信息</a></li>
                                            <li><a href="/Admin/EditUserRole/@item.UserInfoId" data-target="#RoleIdModal" data-toggle="modal">设置用户组</a></li>*@
                                            @*<li><a href="">封禁用户</a></li>没有*@
                                            @*<li><a class="send-passwordreset没有封禁用户这个字段il" href="javascript:" data-url="/admin/user/1/send_passwordreset_email">发送密码重置邮件</a></li>
                                                <li><a class="send-emailverify-email" href="javascript:" data-url="/admin/user/1/send_emailverify_email">发送Email验证邮件</a></li>
                                                <li></li>*@
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        }




                </table>
           
             
                    <!--分页-->
                    <div>
                        <a href="/Admin/user?PageIndex=1" class="btn btn-primary btn-lg active">首页</a>
                   

             

                        <a href="/Admin/user?PageIndex=@Convert.ToInt32((ViewBag.PageIndex - 1) < 1 ? (1) : (ViewBag.PageIndex - 1))" class="btn btn-default">上一页</a>

                        <a href="/Admin/user/?PageIndex=@ViewBag.PageIndex">@ViewBag.PageIndex</a>


                        <a href="/Admin/user?PageIndex=@(Convert.ToInt32((ViewBag.PageIndex + 1) >= ViewBag.PageCount ? (ViewBag.PageCount) : (ViewBag.PageIndex + 1)))" class="btn btn-default">下一页</a>

                        <a href="/Admin/user?PageIndex=@ViewBag.PageCount" class="btn btn-primary btn-lg active">尾页</a>


                    </div>
            </div>
        </div>
    </div>




    @*模态框*@
    @*详细信息显示*@
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">

            </div><!-- /.modal-content -->
        </div>
    </div>

    @*添加用户信息*@

    <div class="modal fade" id="modalAddUser" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog ">


            <div class="modal-content">


                <div class="modal-header">

                    <button class="close" aria-hidden="true" type="button" data-dismiss="modal">×</button>

                    <h4 class="modal-title">
                        添加新用户
                    </h4>


                </div>


                <div class="modal-body">

                    <form class="form-horizontal" action="/admin/AddUser" method="post" novalidate="novalidate" data-widget-cid="widget-0">
                        <div class="row form-group">
                            <div class="col-md-2 control-label">

                                <label for="email">邮箱地址</label>

                            </div>
                            <div class="col-md-7 controls">

                                <input name="Email" class="form-control" id="email" type="text" data-url="/admin/user/create/email/check" data-widget-cid="widget-1" data-explain="" />

                                <div class="help-block" style="display: none;"></div>
                            </div>


                        </div>



                        <div class="row form-group">


                            <div class="col-md-2 control-label">

                                <label for="nickname">用户名</label>

                            </div>


                            <div class="col-md-7 controls">

                                <input name="Uname" class="form-control" id="nickname" type="text" data-url="/admin/user/create/nickname/check" data-widget-cid="widget-2" data-explain="" />

                                <div class="help-block" style="display: none;"></div>
                            </div>


                        </div>



                        <div class="row form-group">


                            <div class="col-md-2 control-label">

                                <label for="password">密码</label>

                            </div>


                            <div class="col-md-7 controls">

                                <input name="Upwd" class="form-control" id="password" type="password" data-widget-cid="widget-3" data-explain="5-20位英文、数字、符号，区分大小写" />

                                <p class="help-block">
                                    5-20位英文、数字、符号，区分大小写
                                </p>


                            </div>


                        </div>



                        <div class="row form-group">


                            <div class="col-md-2 control-label">

                                <label for="confirmPassword">确认密码</label>

                            </div>


                            <div class="col-md-7 controls">

                                <input name="Upwd2" class="form-control" id="confirmPassword" type="password" data-widget-cid="widget-4" data-explain="再输入一次密码" />

                                <p class="help-block">
                                    再输入一次密码
                                </p>


                            </div>


                        </div>


                        <div class="row form-group">


                            <div class="col-md-2 control-label">

                                <label for="roles">用户权限</label>

                            </div>


                            <div class="col-md-7 controls">

                                <input name="RoleId" type="checkbox" value="教师" /> 教师

                            </div>


                        </div>


                        <input name="_csrf_token" type="hidden" value="ceca48efa254597b999868b4a0df04a46140993f" />

                        <div class="modal-footer">
                            <button class="btn btn-primary pull-right" id="user-create-btn" type="submit">提交</button>
                            <button class="btn btn-link pull-right" type="button" data-dismiss="modal">取消</button>
                        </div>
                    </form>
                </div>

            </div>

        </div>
    </div>

    @*修改用户信息模板页*@

    <div class="modal fade" id="myModalEdit" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">

            </div><!-- /.modal-content -->
        </div>
    </div>
    @*用来设置用户身份的模态框*@
    <div class="modal fade" id="RoleIdModal" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">

            </div><!-- /.modal-content -->
        </div>
    </div>

    @*模态框传值问题（加载一次模态框 清楚一下以前的数据  不然数据不变）*@
    <script>
        $("#myModal").on("hidden.bs.modal", function () {
            $(this).removeData("bs.modal");
        })
    </script>

    <script>
        $("#myModalEdit").on("hidden.bs.modal", function () {
            $(this).removeData("bs.modal");
        })
    </script>

    <script>
        function ChangeSealState(obj)//封禁操作
        {
            $.post("/Admin/ChangSealState", { id: obj }, function (data)
            {
                
                if (data == 1)
                {
                    alert("封禁成功");  
                    window.location.href = '/Admin/User';
                }
                if (data == 0)
                {
                    alert("解除禁止");
                   
                    window.location.href = '/Admin/User';
                }

            })

        }
    </script>


    <script>
        var app = {};
        app.debug = false;
        app.version = '6.9.3';
        app.httpHost = 'http://www.zhishile.com';
        app.basePath = '';
        app.theme = 'jianmo';
        app.themeGlobalScript = 'theme/global-script';
        app.jsPaths = { "common": "common", "theme": "\/themes\/jianmo\/js", "customwebbundle": "\/bundles\/customweb\/js", "customadminbundle": "\/bundles\/customadmin\/js", "topxiawebbundle": "\/bundles\/topxiaweb\/js", "topxiaadminbundle": "\/bundles\/topxiaadmin\/js", "classroombundle": "\/bundles\/classroom\/js" };
        app.crontab = '/common/crontab';

        var CKEDITOR_BASEPATH = app.basePath + '/assets/libs/ckeditor/4.6.7/';
        app.config = { "api": { "weibo": { "key": "" }, "qq": { "key": "" }, "douban": { "key": "" }, "renren": { "key": "" } }, "cloud": { "video_player": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/GrindPlayer.swf", "video_player_watermark_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Watermake-1.0.3.swf", "video_player_fingerprint_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Fingerprint-1.0.1.swf" }, "loading_img_path": "\/assets\/img\/default\/loading.gif?6.9.3" };
        app.arguments = {};
        app.controller = 'user/list';

        app.scripts = null;

        app.uploadUrl = '/file/upload';
        app.imgCropUrl = '/file/img/crop';
        app.lessonCopyEnabled = '0';
        app.mainScript = '/bundles/topxiaadmin/js/admin-app.js?6.9.3';
    </script>
    <script src="/Content/js/sea.js?6.9.3"></script>
    <script src="/Content/js/seajs-style.js?6.9.3"></script>
    <script src="/Content/js/seajs-global-config.js?6.9.3"></script>
    <script>
        seajs.use(app.mainScript);
    </script>  <div id="modal" class="modal"></div>
    <div class="fixed-bar">
        <a href="/admin/feedback" target='_blank' class="icon-question-text feedback">
            <i class="es-icon es-icon-help"></i>
            <span>产品<br />反馈</span>
        </a>
    </div>
</body>
</html>



